{% extends "../master.html" %}

{% block header %}
    {% include "../header.html" %}
{% endblock %}

{% block menu %}
    {% include "menu_edit.html" %}
{% endblock %}

{% block page %}
    <h3>Category:</h3>
    <form class="form" action="/category/edit" method="post">
    <div class="button">
        <b>{{ wiki.category.title }}</b> ..
        <input name="edit" value="Edit" type="submit" /> ||
        <select name="select_category_key">
            {% for c in categories %}
                {% ifequal c.key wiki.category.key %}
                    <option selected="selected" value="{{ c.key }}">{{ c.title }}</option>
                {% else %}
                    <option value="{{ c.key }}">{{ c.title }}</option>
                {% endifequal %}
            {% endfor %}
        </select> |
        <input name="select" value="Select" type="submit" /> ||
        <input name="new" value="New" type="submit" />
        {% if wiki.category %}
            <input name="category_key" value="{{ wiki.category.key }}" type="hidden" />
        {% else %}
            <input name="category_key" value="" type="hidden" />
        {% endif %}
        <input name="wiki_key" value="{{ wiki.key }}" type="hidden" />
        <input name="language_key" value="{{ language.key }}" type="hidden" />
    </div>
    </form>
    <h3>Position:</h3>
    <form class="form" action="/wiki/position" method="post">
    <div class="button">
        <b>{{ wiki.position }}</b> ..
        <input name="up" value="Up" type="submit" /> |
        <input name="down" value="Down" type="submit" />
        <input name="wiki_key" value="{{ wiki.key }}" type="hidden" />
        <input name="language_key" value="{{ language.key }}" type="hidden" />
    </div>
    </form>

    <h3>Title:</h3>
    <form class="form" action="/wiki/save" method="post">
    <div class="button">
        <input name="title" value="{{ wiki.title }}" type="text" />
        <h3>Content:</h3>
        <textarea name="content" rows="24" cols="80" wrap="off">{{ wiki.content }}</textarea>
        <p>
            <input name="cancel" value="Cancel" type="submit" /> ||
            <input name="save" value="Save" type="submit" /> |
            <input name="new" value="New" type="submit" /> ||
            <input name="delete" value="Delete" type="submit" />
        </p>
        <input name="wiki_key" value="{{ wiki.key }}" type="hidden" />
        <input name="language_key" value="{{ language.key }}" type="hidden" />
    </div>
    </form>

    {% block list_image %}
        {% include "../list_content_image.html" %}
    {% endblock %}

{% endblock %}

{% block footer %}
    {% include "../footer.html" %}
{% endblock %}
